import config from '@/config'
import variables from '@/assets/style/element-variables.scss'

export default {
  namespaced: true,
  state: {
    showSettings: config.showSettings,
    tagsView: config.tagsView,
    fixedHeader: config.fixedHeader,
    theme: variables.theme,
    sidebarLogo: config.sidebarLogo,
    supportPinyinSearch: config.supportPinyinSearch

  },
  mutations: {
    CHANGE_SETTING: (state, { key, value }) => {
      if (state.hasOwnProperty(key)) {
        state[key] = value
      }
    }

  },
  actions: {
    changeSetting({ commit }, data) {
      commit('CHANGE_SETTING', data)
    },


  }
}